option( PLUGIN_STANDARD_QPCL "Install qPCL plugin" OFF )

if( PLUGIN_STANDARD_QPCL )	  
	project( QPCL_PLUGIN )
	
	AddPlugin( NAME ${PROJECT_NAME} )

	add_subdirectory( doc )
	add_subdirectory( include )
	add_subdirectory( src )
	
	add_subdirectory( PclUtils ) # PCL bridge library
	add_subdirectory( PclIO ) # PCL I/O plugin (to load PCD files)

	# # 提示用户输入 lz4 调试版本库的路径
    # message("Please enter the path to the lz4 debug library:")
    # set(lz4_LIBRARY_DEBUG "" CACHE PATH "Path to lz4 debug library")

    # # 提示用户输入 lz4 发布版本库的路径
    # message("Please enter the path to the lz4 release library:")
    # set(lz4_LIBRARY_RELEASE "" CACHE PATH "Path to lz4 release library")

    # # 输出用户输入的路径
    # message("lz4 debug library path set to: ${lz4_LIBRARY_DEBUG}")
    # message("lz4 release library path set to: ${lz4_LIBRARY_RELEASE}")


	include_directories("${lz4_DIR}/include/" ${FLANN_INCLUDE_DIR})
	# target_link_libraries( ${PROJECT_NAME} QPCL_PLUGIN_UTILS_LIB debug ${lz4_LIBRRARY_DEBUG} optimized ${lz4_LIBRRARY_RELEASE})
	target_link_libraries( ${PROJECT_NAME} QPCL_PLUGIN_UTILS_LIB debug "${lz4_DIR}/lib/debug/lz4.lib" optimized "${lz4_DIR}/lib/release/lz4.lib")
	if (CMAKE_BUILD_TYPE AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
        # target_link_libraries( ${PROJECT_NAME} ${FLANN_LIBRRARY_DEBUG_STATIC})
		target_link_libraries( ${PROJECT_NAME} ${FLANN_LIBRARY_DEBUG_STATIC})
	else ()
		# target_link_libraries( ${PROJECT_NAME} ${FLANN_LIBRRARY_STATIC})
		target_link_libraries( ${PROJECT_NAME} ${FLANN_LIBRARY_STATIC})
	endif ()
		
	# Import PCL dlls (if any, WIN32 only)
	include( cmake/ExportPCLDlls.cmake )
	export_PCL_dlls( "${CLOUDCOMPARE_DEST_FOLDER}" )
endif()
